package testing.comparer;

import static org.junit.Assert.assertEquals;

import org.junit.Before;
import org.junit.Test;

import words.Preposition;
import words.Punctuation;
import words.Quotation;

import comparer.PrepComparer;
import comparer.PuntComparer;
import comparer.QuotationComparer;


public class PuntComparerTest {
	PuntComparer comparer;
	Punctuation origin_punp;
	Punctuation compared_punp;

	@Before
	public void setUp() throws Exception {
		this.comparer = new PuntComparer();
		this.origin_punp = new Punctuation();
		this.compared_punp = new Punctuation();
	}
	@Test
	public void test1()
	{
		String origin = "-";
		String compare = "-";
		origin_punp.input(origin);
		compared_punp.input(compare);
		comparer.set_origin(origin_punp);
		comparer.set_compared(compared_punp);
		comparer.compare();
		int result = comparer.getResult();
		assertEquals(result,1);
	}
	@Test
	public void test2()
	{
		String origin = "?";
		String compare = "-";
		origin_punp.input(origin);
		compared_punp.input(compare);
		comparer.set_origin(origin_punp);
		comparer.set_compared(compared_punp);
		comparer.compare();
		int result = comparer.getResult();
		assertEquals(result,0);
	}
	@Test
	public void test3()
	{
		String origin = "?";
		String origin2 = "-";
		String compare = "?";
		String compare2 = "-";
		origin_punp.input(origin);
		origin_punp.input(origin2);
		compared_punp.input(compare);
		compared_punp.input(compare2);
		comparer.set_origin(origin_punp);
		comparer.set_compared(compared_punp);
		comparer.compare();
		int result = comparer.getResult();
		assertEquals(result,2);
	}
	@Test
	public void test4()
	{
		String origin = "?";
		String origin2 = "-";
		String compare = "!";
		String compare2 = "?";
		origin_punp.input(origin);
		origin_punp.input(origin2);
		compared_punp.input(compare);
		compared_punp.input(compare2);
		comparer.set_origin(origin_punp);
		comparer.set_compared(compared_punp);
		comparer.compare();
		int result = comparer.getResult();
		assertEquals(result,1);
	}
	@Test
	public void test5()
	{
		String origin = "?";
		String origin2 = "-";
		String compare = "/";
		String compare2 = "!";
		origin_punp.input(origin);
		origin_punp.input(origin2);
		compared_punp.input(compare);
		compared_punp.input(compare2);
		comparer.set_origin(origin_punp);
		comparer.set_compared(compared_punp);
		comparer.compare();
		int result = comparer.getResult();
		assertEquals(result,0);
	}
}
